import defaultSettings from '../config/defaultSettings';

const Global = {
    getItem(key: string) {
        let value = localStorage.getItem(key);
        if (value) {
            return JSON.parse(String(localStorage.getItem(key)));
        } else {
            return null;
        }
    },
    setItem(key: string, value: any) {
        localStorage.setItem(key, JSON.stringify(value));
    },
    getDefaultSettings() {
        return defaultSettings;
    },
}

export default Global;